package com.azt.api.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 询价单项目状态
 * 
 * @author 张栋 2016年8月8日下午3:42:52
 */
public enum EnqProjectEnum {

	/* 项目状态1：询价中 2、已完成 3、已验收 4：已关闭 */
	//PROJ_ENQING(1, "询价中"), PROJ_COMPLETE(2, "已完成"), ROLE_ACCEPT(3, "已验收"), ROLE_CLOSE(4, "已关闭");
	/**
	 * 项目状态变更
	 * 项目状态1：进行中 2：项目关闭'
	 * Created by 张栋 on 2016/9/14 11:24
	 */
	PROJ_NOSTAT(0, "未知"),PROJ_ONLINE(1, "进行中"),ROLE_CLOSE(2, "已取消");

	private int index;
	private String name;

	private EnqProjectEnum(int index, String name) {
		this.index = index;
		this.name = name;
	}

	/**
	 * 获取所有角色
	 * 
	 * @return
	 */
	public static Map<String, String> getAllProjectStat() {
		Map<String, String> projects = new HashMap<String, String>();
		for (EnqProjectEnum c : EnqProjectEnum.values()) {
			projects.put(c.getIndex() + "", c.getName());
		}
		return projects;
	}

	public static String getName(int index) {
		for (EnqProjectEnum c : EnqProjectEnum.values()) {
			if (c.getIndex() == index) {
				return c.name;
			}
		}
		return null;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
